package com.xmh.autocode.inject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.util.Map;

@Component
public class Inject {

    private static DataSource druidDataSource;

    private static String vo_Path;

    private static String xml_Path;

    private static Map<String, String> configFiles;

    private static Map<String, String> logicFiles;

    @Autowired
    private void setDruidDataSource(DataSource druidDataSource) {
        Inject.druidDataSource = druidDataSource;
    }

    @Value("${modelConfig.dataBaseFiles.voFile}")
    private void setVo_Path(String vo_Path) {
        Inject.vo_Path = vo_Path;
    }

    @Value("${modelConfig.dataBaseFiles.xmlFile}")
    private void setXml_Path(String xml_Path) {
        Inject.xml_Path = xml_Path;
    }

    public static void setLogicFiles(Map<String, String> logicFiles) {
        Inject.logicFiles = logicFiles;
    }

    public static void setConfigFiles(Map<String, String> configFiles) {
        Inject.configFiles = configFiles;
    }

    public static DataSource getDruidDataSource() {
        return druidDataSource;
    }

    public static String getVo_Path() {
        return vo_Path;
    }

    public static String getXml_Path() {
        return xml_Path;
    }

    public static Map<String, String> getConfigFiles() {
        return configFiles;
    }

    public static Map<String, String> getLogicFiles() {
        return logicFiles;
    }
}
